package com.dx.architectureddd.infrastructure.config;

import com.dx.architectureddd.app.chain.init.*;
import com.dx.architectureddd.app.chain.third.ThirdContext;
import com.dx.architectureddd.app.chain.third.ThirdInit;
import com.dx.architectureddd.common.dp.pipeline.PipelineFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;

/**
 * 链设计模式
 *
 * @author xin.deng
 * @date 2023/09/24
 */
@Configuration
public class RulePipelineConfig {
    @Bean
    public PipelineFactory<InitContext> initContextPipelineFactory() {
        return new PipelineFactory(InitContext.class, Arrays.asList(
                LevelInit.class,
                MonsterInit.class,
                SceneInit.class,
                RewardInit.class
        ));
    }

    @Bean
    public PipelineFactory<ThirdContext> thirdContextPipelineFactory() {
        return new PipelineFactory(ThirdContext.class, Arrays.asList(
                ThirdInit.class
        ));
    }
}
